Skip to content

Java: add Apple Silicon macOS in-process runtime and native classifier publishing - #2402

Merged
edburns merged 1 commit into
mainfrom
edburns/2399-embed-rust-java-darwin-arm64
Aug 26, 2026
Merged

Java: add Apple Silicon macOS in-process runtime and native classifier publishing#2402
edburns merged 1 commit into
mainfrom
edburns/2399-embed-rust-java-darwin-arm64

Conversation

@edburns

@edburns edburns commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Implements the darwin-arm64 portion of #2399.

Fixes #2400.

Summary

Adds Apple Silicon macOS (darwin-arm64) as a supported target for the Java SDK's experimental in-process runtime, alongside the existing GNU/Linux linux-x64 and Windows win32-x64 targets delivered by #2301 and #2393.

  • Packages a macOS native classifier containing runtime.node, copilot, and platform.properties.
  • Activates and validates the darwin-arm64 classifier automatically on Apple Silicon macOS, including when Maven runs with -Pinprocess.
  • Extends native fetch, host-validation, artifact-validation, and local-publication tests to cover Darwin artifacts and reject unsupported Intel macOS hosts.
  • Runs the Java in-process test suite on macos-26 in addition to the existing Ubuntu and Windows matrix.
  • Builds the Darwin classifier on an Apple Silicon macOS runner and adds it to the blocking publication-assembly test.
  • Extends both snapshot and Maven Central release workflows so Linux, Windows, and Darwin classifiers are built on their matching native hosts and published together in one Maven deployment.
  • Documents Apple Silicon setup, classifier contents, supported-host behavior, and the updated ADR-007 platform status.

User experience

In-process mode remains opt-in, experimental, and unchanged for existing Linux and Windows consumers. The SDK's default connection behavior is also unchanged.

An Apple Silicon macOS application enables in-process mode by:

  1. Depending on com.github:copilot-sdk-java-runtime with classifier darwin-arm64, plus JNA.
  2. Configuring CopilotClientOptions with RuntimeConnection.forInProcess().

The classifier JAR contains:

native/darwin-arm64/runtime.node
native/darwin-arm64/platform.properties
native/darwin-arm64/copilot

For SDK development on Apple Silicon, mvn -Pinprocess clean verify detects darwin-arm64, validates that the host is macOS ARM64, fetches the pinned @github/copilot-darwin-arm64 package, packages its version-matched runtime and transitional CLI, and exercises the in-process integration suite. Intel macOS and other unsupported OS/architecture combinations fail explicit in-process host validation rather than packaging the wrong binary.

During the active Rust migration, the classifier intentionally includes the version-matched copilot embedded-host executable in addition to runtime.node. It can be removed once the native runtime no longer delegates unported method bodies to the CLI.

Packaging and publication model

This extends the coordinated publication model introduced by #2393 from two native classifiers to three:

Classifier Build host Native contents
linux-x64 Ubuntu x64 glibc runtime.node, copilot, metadata
win32-x64 Windows x64 runtime.node, copilot.exe, metadata
darwin-arm64 Apple Silicon macOS runtime.node, copilot, metadata

The macOS job builds only the darwin-arm64 classifier and a SHA-256 manifest. The sole Ubuntu publisher then:

  1. Verifies that the macOS and Windows handoffs came from the same immutable source and Maven version as the Linux build.
  2. Verifies each checksum, expected filename, pinned native-runtime version, required contents, and absence of cross-classifier contamination.
  3. Attaches the external Windows and Darwin classifier JARs to the Maven reactor.
  4. Builds linux-x64 locally and performs one deployment containing the neutral SDK artifacts and all three native classifiers.

Using one deployment preserves a shared Maven snapshot timestamp/build number and ensures release signing covers every classifier. Snapshot and release summaries now report the build host, filename, and SHA-256 hash for all three classifiers.

CI and safety checks

  • The in-process Actions matrix covers linux-x64, win32-x64, and darwin-arm64.
  • A dedicated macos-26 job builds and validates the Darwin publication input before upload.
  • Blocking publication assembly downloads both external native artifacts and validates the complete signed local repository before publication workflows can drift unnoticed.
  • Host validation accepts only darwin + arm64 for darwin-arm64; Intel macOS and non-macOS hosts are rejected.
  • Artifact validation requires a nonempty Darwin runtime.node, copilot, and matching platform.properties.
  • Local-publication validation requires all three classifiers and rejects native resources from the wrong platform.
  • Fetch tests cover complete, missing, and stale Darwin staging states.

Validation coverage

  • Darwin native-host acceptance and rejection tests.
  • Darwin classifier artifact-validation tests.
  • Three-classifier local-publication validation and contamination tests.
  • Native fetch tests across Linux, Windows, and Darwin classifiers.
  • Apple Silicon mvn -Pinprocess clean verify in the Java CI matrix.
  • Native publication-input build on macos-26.
  • Complete Linux/Windows/Darwin local publication assembly on Ubuntu.

@edburns
edburns requested a review from a team as a code owner August 25, 2026 22:14
Copilot AI balanced review requested due to automatic review settings August 25, 2026 22:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Java in-process runtime packaging and publication support for Apple Silicon macOS.

Changes:

  • Adds darwin-arm64 Maven profiles and native validation.
  • Extends CI and publication workflows to three classifiers.
  • Updates tests and documentation.
Show a summary per file
File Description
java/sdk/pom.xml Selects the Darwin test runtime.
java/copilot-native/pom.xml Packages and attaches Darwin artifacts.
java/copilot-native/scripts/validate-native-host.mjs Validates Darwin ARM64 hosts.
java/copilot-native/scripts/validate-native-host.test.mjs Tests Darwin host validation.
java/copilot-native/scripts/validate-native-artifact.mjs Detects native resources across platforms.
java/copilot-native/scripts/validate-native-artifact.test.mjs Tests Darwin artifacts and publications.
java/copilot-native/scripts/validate-local-publication.mjs Requires all three classifiers.
java/copilot-native/scripts/fetch-native.test.mjs Adds Darwin fetch coverage.
.github/workflows/java-sdk-tests.yml Adds Darwin tests and publication assembly.
.github/workflows/java-publish-maven.yml Adds Darwin release publication.
.github/workflows/java-publish-snapshot.yml Adds Darwin snapshot publication.
java/README.md Documents Darwin support.
java/docs/adr/adr-007-native-bundling-strategy.md Records the three-platform strategy.
2399-embed-rust-java-darwin-arm64-remove-before-merge/20260825-prompts.md Adds a temporary session transcript.
2399-embed-rust-java-darwin-arm64-remove-before-merge/20260825-implement-darwin-arm64.md Adds a temporary implementation prompt.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 15/15 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread 2399-embed-rust-java-darwin-arm64-remove-before-merge/20260825-prompts.md Outdated
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@edburns

edburns commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

Validate locally

  • darwin-arm64

    • ✅ mvn -Pinprocess clean verify

      Log file: /Users/edburns/workareas/copilot-sdk/20260825-1408-profile-job-logs.txt

    • ✅ mvn clean verify

      Log file: /Users/edburns/workareas/copilot-sdk/java/20260825-1622-job-logs.txt

    • ✅ mvn jacoco:prepare-agent@wire-up-coverage-instrumentation antrun:run@print-test-jdk-banner surefire:test failsafe:integration-test failsafe:verify jacoco:report@build-coverage-report-from-tests -Denforcer.skip=true

      Log file: /Users/edburns/workareas/copilot-sdk/java/20260825-1631-job-logs.txt

  • linux-x64

    • ✅ mvn -Pinprocess clean verify

      Log file: /home/edburns/workareas/copilot-sdk/java/20260825-1616-job-logs.txt

    • ✅ mvn clean verify

      Log file: /home/edburns/workareas/copilot-sdk/java/20260825-1621-job-logs.txt

    • ✅ mvn jacoco:prepare-agent@wire-up-coverage-instrumentation antrun:run@print-test-jdk-banner surefire:test failsafe:integration-test failsafe:verify jacoco:report@build-coverage-report-from-tests -Denforcer.skip=true

      Log file: /home/edburns/workareas/copilot-sdk/java/20260825-1630-job-logs.txt

  • win32-x64

    • ✅ mvn -Pinprocess clean verify

      Log file: C:\Users\edburns\workareas\copilot-sdk\java\20260825-1610-job-logs.txt

    • ✅ mvn clean verify

      Log file: C:\Users\edburns\workareas\copilot-sdk\java\20260825-1618-job-logs.txt

    • ✅ mvn jacoco:prepare-agent@wire-up-coverage-instrumentation antrun:run@print-test-jdk-banner surefire:test failsafe:integration-test failsafe:verify jacoco:report@build-coverage-report-from-tests -Denforcer.skip=true

      Log file: C:\Users\edburns\workareas\copilot-sdk\java\20260825-1638-job-logs.txt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

GUTDODP

GUTDODP

GUTDOP

Remove prompts
@edburns
edburns force-pushed the edburns/2399-embed-rust-java-darwin-arm64 branch from 03e75cd to 4a0454d Compare August 25, 2026 23:58
@edburns edburns changed the title [Java] Embed Rust: darwin-arm64 Java: add Apple Silicon macOS in-process runtime and native classifier publishing Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR extends the Java SDK's experimental in-process native runtime to support Apple Silicon macOS (darwin-arm64), alongside the existing linux-x64 and win32-x64 classifiers.

All 13 changed files are Java-specific (CI workflows, java/copilot-native/, java/sdk/pom.xml, java/README.md, and ADR documentation). No changes are made to nodejs/, python/, go/, dotnet/, or rust/.

No cross-SDK consistency issues found. The in-process native runtime is a Java-only experimental feature — it is not part of the shared public API surface (session creation, tool invocation, streaming, etc.) that is mirrored across all SDKs. Adding darwin-arm64 as a third supported platform is an internal extension of this Java-specific capability and does not warrant parallel changes in other SDK implementations.

Generated by SDK Consistency Review Agent for #2402 · sonnet46 17.8 AIC · ⌖ 5.39 AIC · ⊞ 6.6K ·

@edburns
edburns merged commit 48b280a into main Aug 26, 2026
41 checks passed
@edburns
edburns deleted the edburns/2399-embed-rust-java-darwin-arm64 branch August 26, 2026 00:10
@edburns
edburns restored the edburns/2399-embed-rust-java-darwin-arm64 branch August 26, 2026 00:10
@edburns
edburns deleted the edburns/2399-embed-rust-java-darwin-arm64 branch August 26, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Java] Initial implementation for darwin-arm64

2 participants